#ifndef REGULAREXPRESSIONS_REGEX_H
#define REGULAREXPRESSIONS_REGEX_H

#include <string>
#include <cstring>

extern "C"
{
	#include <regex.h>
}

#include "Match.hpp"
#include "ArgumentException.hpp"


namespace RegularExpressions
{
	class Regex
	{
		private:
		
		regex_t				_preg;
		
		
		public:
		
		Regex(const char* regex, int flags = 0) throw(ArgumentException);
		Regex(const std::string& regex, int flags = 0) throw(ArgumentException);
		~Regex();
		
		bool isMatch(const char* string, int flags = 0) const;
		bool isMatch(const std::string& string, int flags = 0) const;
		Match match(const char* string, int flags = 0) const;
		Match match(const std::string& string, int flags = 0) const;
		std::string replace(const std::string& string, const std::string& replace, int flags = 0) const;
	};
}


#endif


